package com.lc.user.express.httpserver;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

/**
 * Created by Administrator on 2016/3/30.积分兑换优惠券
 */
@HttpInlet(Net.GET_EXCHANGECOUPON)
public class GetExchangecoupon extends ZJDBAsyGet<Object> {
   public  String userid;
   public String counponid;//积分兑换列表id

    public GetExchangecoupon(String userid, String counponid, AsyCallBack asyCallBack) {
        super(asyCallBack);
        this.userid = userid;
        this.counponid = counponid;
    }

    @Override
    protected Object parser(JSONObject object) {
        if (object.optInt("message")==1){
            TOAST="兑换成功";
            return "1";
        }else if (object.optInt("message")==2){
            TOAST="积分不足";
            return "2";
        }else if (object.optInt("message")==0){
            TOAST="兑换失败";
            return "0";
        }
        return null;
    }


}
